package com.cet.designapplication.pay.strategy.factory;

import com.alipay.api.domain.ShieldDishList;
import lombok.Getter;

/**
 * @author NSOC
 */

@Getter
public enum StrategyEnum {

    ALIPAY(1, "com.cet.designapplication.pay.strategy.AlipayStrategy"),

    WECHAT_PAY(2, "com.cet.designapplication.pay.strategy.WechatPayStrategy")
    ;

    private final Integer code;

    private final String value;

    StrategyEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public static StrategyEnum getPayStrategy(Integer payType) {
        for (StrategyEnum strategyEnum : StrategyEnum.values()) {
            if (strategyEnum.code.equals(payType)) {
                return strategyEnum;
            }
        }
        throw new UnsupportedOperationException("payType is not support");
    }
}
